<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title></title>

    <style type="text/css">
        html, body {
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
            overflow: hidden;
        }

        #map {
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>

    <div id="map"></div>
    <canvas id="canvas"></canvas>

    <script type="text/javascript" src="//apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script type="text/javascript" src="//api.map.baidu.com/api?v=2.0&ak=1XjLLEhZhQNUzd93EjU5nOGQ"></script>
    <script type="text/javascript" src="../build/mapv.js"></script>

    <script type="text/javascript">

        // 百度地图API功能
        var map = new BMap.Map("map", {
            enableMapClick: false
        });    // 创建Map实例
        map.centerAndZoom(new BMap.Point(105.403119, 38.028658), 5);  // 初始化地图,设置中心点坐标和地图级别
        map.enableScrollWheelZoom(true); // 开启鼠标滚轮缩放

        map.setMapStyle({
            style: 'grayscale'
        });

        $.get('data/point.csv', function(csvstr) {

            var options = {
                size: 4,
                gradient: { 0.25: "rgb(0,0,255)", 0.55: "rgb(0,255,0)", 0.85: "yellow", 1.0: "rgb(255,0,0)"},
                max: 20,
                fillStyle: 'blue',
                draw: 'simple',
                methods: { // 一些事件回调函数
                    click: function (item) { // 点击事件，返回对应点击元素的对象值
                        console.warn(item);
                    },
                    mousemove: function (item) { // 鼠标移动事件，对应鼠标经过的元素对象值
                        // console.log(item);
                    }
                },
            }
            debugger;
            var dataSet = mapv.csv.getDataSet(csvstr);
            dataSet.initGeometry();

            var mapvLayer = new mapv.baiduMapLayer(map, dataSet, options);

        });

    </script>
	
</body>
</html>
